.TH "Zebulon::MCU::Message" 3 "13 Oct 2009" "Version 2" "zebulon" \" -*- nroff -*-
.ad l
.nh
.SH NAME
Zebulon::MCU::Message \- 
.PP
\fBInterface\fP class for creating messages structures for serialization and de-serialization of data sent to/from a Microcontroller.  

.SH SYNOPSIS
.br
.PP
.PP
\fC#include <message.h>\fP
.PP
Inherited by \fBZebulon::MCU::Ping\fP, \fBZebulon::MCU::Pong\fP, \fBZebulon::MCU::QueryReport\fP, \fBZebulon::MCU::ReportAnalogInputs\fP, \fBZebulon::MCU::ReportDigitalInputs\fP, \fBZebulon::MCU::SetDigitalOutputs\fP, \fBZebulon::Underwater::ReportMotorAddressChange\fP, \fBZebulon::Underwater::ReportMotorStatus\fP, \fBZebulon::Underwater::ReportMotorStatus1\fP, \fBZebulon::Underwater::ReportMotorStatus2\fP, \fBZebulon::Underwater::SetMotorAddress\fP, and \fBZebulon::Underwater::SetMotorThrust\fP.
.SS "Public Types"

.in +1c
.ti -1c
.RI "typedef std::vector< \fBMessage\fP * > \fBList\fP"
.br
.RI "\fIType definition for a Vector of \fBMessages\fP. \fP"
.ti -1c
.RI "typedef unsigned char \fBCode\fP"
.br
.RI "\fIType definition for message command code. \fP"
.in -1c
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBMessage\fP (const \fBMessage::Code\fP messageCode)"
.br
.ti -1c
.RI "virtual int \fBWrite\fP (CxUtils::Packet &packet) const "
.br
.ti -1c
.RI "virtual int \fBWriteMessageBody\fP (CxUtils::Packet &packet) const "
.br
.ti -1c
.RI "virtual int \fBRead\fP (const CxUtils::Packet &packet)"
.br
.ti -1c
.RI "virtual int \fBReadMessageBody\fP (const CxUtils::Packet &packet)"
.br
.ti -1c
.RI "virtual void \fBPrint\fP () const "
.br
.ti -1c
.RI "virtual \fBMessage\fP * \fBClone\fP () const =0"
.br
.in -1c
.SS "Static Public Member Functions"

.in +1c
.ti -1c
.RI "static unsigned char \fBCalculateChecksum\fP (const CxUtils::Packet &packet)"
.br
.ti -1c
.RI "static bool \fBIsValid\fP (const CxUtils::Packet &packet)"
.br
.ti -1c
.RI "static unsigned int \fBExtractMessage\fP (const unsigned char *buffer, const unsigned int length, \fBMessage::Code\fP &type, CxUtils::Packet &message)"
.br
.in -1c
.SS "Public Attributes"

.in +1c
.ti -1c
.RI "\fBMessage::Code\fP \fBmMessageCode\fP"
.br
.RI "\fI\fBMessage\fP code (type of message). \fP"
.in -1c
.SS "Static Public Attributes"

.in +1c
.ti -1c
.RI "static const unsigned char \fBHeader1\fP = '#'"
.br
.RI "\fIFirst Header byte for all \fBMessages\fP. \fP"
.ti -1c
.RI "static const unsigned char \fBHeader2\fP = '%'"
.br
.RI "\fISecond Header byte for all \fBMessages\fP. \fP"
.ti -1c
.RI "static const unsigned int \fBStartOfCommandType\fP = 2"
.br
.RI "\fIStarting index of command type. \fP"
.ti -1c
.RI "static const unsigned int \fBStartOfData\fP = 3"
.br
.RI "\fIStarting index of data in byte array. \fP"
.ti -1c
.RI "static const unsigned int \fBSize\fP = 8"
.br
.RI "\fISize of all messages in bytes. \fP"
.ti -1c
.RI "static const unsigned int \fBDataSize\fP = 4"
.br
.RI "\fISize of all data in bytes. \fP"
.ti -1c
.RI "static const \fBCode\fP \fBAll\fP = 0xFF"
.br
.ti -1c
.RI "static const \fBCode\fP \fBQueryReport\fP = 0x00"
.br
.RI "\fI\fBMessage\fP code for a Query Report. \fP"
.ti -1c
.RI "static const \fBCode\fP \fBPing\fP = 0x0D"
.br
.RI "\fI\fBMessage\fP code for a \fBPing\fP \fBMessage\fP. \fP"
.ti -1c
.RI "static const \fBCode\fP \fBPong\fP = 0x84"
.br
.RI "\fI\fBMessage\fP code for a \fBPong\fP \fBMessage\fP. \fP"
.ti -1c
.RI "static const \fBCode\fP \fBSetDigitalOutputs\fP = 0x0C"
.br
.ti -1c
.RI "static const \fBCode\fP \fBReportDigitalInputs\fP = 0x82"
.br
.ti -1c
.RI "static const \fBCode\fP \fBReportAnalogInputs\fP = 0x83"
.br
.in -1c
.SH "Detailed Description"
.PP 
\fBInterface\fP class for creating messages structures for serialization and de-serialization of data sent to/from a Microcontroller. 

MCU messages are designed to be very simple to make it easy to add support for them on any type of Microcontroller. Therefore messages are of a fixed size and have a unique header (two bytes) and a simple checksum at the end. 

.SH "Author"
.PP 
Generated automatically by Doxygen for zebulon from the source code.
